0

The below scenario was working well yesterday but stopped working today. I have a submit button to generate a PDF for a container >> then add the generated PDF inside the list item attachment contr

Here is the formula for the submit button:-

UpdateContext({varIsDraftPrintForm:true});
UpdateContext({varIsRejectedPrintForm:false});
UpdateContext({varIsInProgressPrintForm: false});
Notify("3",NotificationType.Information);
Set(
    varWorkOrderPDF,
    PDF(
        'PDF container',
        {ExpandContainers: true}
    )
);
Notify("4",NotificationType.Information);
//the file to be added asa list item attachment
Set(varAttachment, { DisplayName: Substitute("Print Job" & Text(Now(),"yyyy-mmm-dd hh:mmm AM/PM") & ".pdf", ":","_"), Id: Substitute("Print Job" & Text(Now(),"yyyy-mmm-dd hh:mmm AM/PM") & ".pdf",":","_"), Value: Substitute(JSON(varWorkOrderPDF,JSONFormat.IncludeBinaryData),"""","")});
Notify("5",NotificationType.Information);

IfError(
SubmitForm(PrintFormForm);Notify("6",NotificationType.Information);,
    Notify(
        "Error Submitting the Print form",NotificationType.Error,10000)
    );
//clear our the attahcment variaible so the other attachent will be shown
Set(varAttachment,Blank());

and i set the following property inside the Attachment control item property:-

If(IsBlank(varAttachment),Parent.Default,varAttachment)

yesterday when i click on the submit button >> the PDF will get generated and the form will be submitted then show the generated PDF as an attachment. also if there are other attachments, and i click on the submit button >> the list item attachments control will be cleared out temporary till the PDF is generated , then once i clear the varAttachment variable (last formula in my code), then old attachments and the new pdf will appear inside the attachment control.

but today when i click on the submit button, the form will be submitted, but the pdf will not attached, and i added the notification for debugging, where the wired thing also is that the notification message =""5 " will not be shown, here is the notifications when i click on the submit button:-

johnjohnPter_0-1700523266502.png

any advice what is going on ? again this was working well yesterday and all the previous week. not sure why the PDF is no longer get attached to the list item

1 Answer 1

-1

The provided code appears to be handling the creation and attachment of a PDF file to a list item in PowerApps. However, there seems to be an issue with attaching the PDF to the list item.

The code segments responsible for creating and attaching the PDF are as follows:

Set(
    varWorkOrderPDF,
    PDF(`enter code here`
        'PDF container',
        {ExpandContainers: true}
    )
);
3

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.