if(profileid_label === null || profileid_label.length < 1){
profile_CreateService.execute();// run your function
}
I am not sure what the best approach is for making a conditional statement for actions.
I have made a profile page. I want new users with no profile to see a CreateService to make a new profile.
If the user has a profile already loaded in the ProfilesDataBase, I'd like to just have them update.
The problem I am having is that after the delete button(delete service) is executed.
When I add an event after the delete, for example, a LISTSERVICE, there is nothing in the ProfilesDataBase. So there are no InputFields for the user to create a new profile.
When I add an event after the delete that is a CREATESERVICE, the old data still remains...it's like there is not enough time for the data to be deleted. The input fields automatically repopulate with the old data that was displayed.
I am having a tough time, because I don't know if I should make a small javascript that should check things when a user visits the PROFILE PAGE or I should do something else, like something in the order of my Services that is wrong.
I can update the profile that exists, no problem. I just want blank input fields where there is NO PROFILE, and if there is an existing profile, I'd like to give the user the option to DELETE the Profile and immediately CREATE a new Profile. I tried running the profile_CREATESERVICE after the SUCCESS with the profile_DELETESERVICE, but this does not work, as the old data remains.
How can I fix this? Thank you