Search This Blog

Friday, December 25, 2020

A piece of Code Add, edit,save ,cancel,reload.

 Hi  All find code of Add, edit,save ,cancel,reload in powerapp,

Icon

Code Logic

Add New

UpdateContext({NewDisplayMode: DisplayMode.Edit}); UpdateContext({EditDisplayMode: DisplayMode.Disabled})

Edit

UpdateContext({NewDisplayMode: DisplayMode.Disabled}); UpdateContext({EditDisplayMode: DisplayMode.Edit})

Cancel

UpdateContext({NewDisplayMode: DisplayMode.Disabled}); UpdateContext({EditDisplayMode: DisplayMode.Disabled})

Save

If (NewDisplayMode = DisplayMode.Edit,

    If (!IsBlank(LastNameField) && !IsBlank(EmailAddressField),

        SubmitForm(AddNewForm); ResetForm(AddNewForm); Refresh(Contacts),

        Notify("Cannot create record. Missing data.", NotificationType.Error)),

    true);

UpdateContext({NewDisplayMode: DisplayMode.Disabled}); UpdateContext({EditDisplayMode: DisplayMode.Disabled})

Reload

Refresh(Contacts)


No comments:

Post a Comment