Code to encrypt a pdf using python: import PyPDF2 pdfFile = open(‘meetingminutes.pdf’, ‘rb’) pdfReader = PyPDF2.PdfFileReader(pdfFile) pdfWriter = PyPDF2.PdfFileWriter() for pageNum in range(pdfReader.numPages): pdfWriter.addPage(pdfReader.getPage(pageNum)) pdfWriter.encrypt(‘swordfish’) resultPdf = open(‘encryptedminutes.pdf’, ‘wb’) pdfWriter.write(resultPdf) resultPdf.close()
Author: SRUTHY N S
Python code for creating a quiz generator with 35 different form contains same question but different order to prevent cheating.
import random # The quiz data. Keys are states and values are their capitals. capitals={‘Alabama’: ‘Montgomery’, ‘Alaska’: ‘Juneau’, ‘Arizona’: ‘Phoenix’, ‘Arkansas’: ‘Little Rock’, ‘California’: ‘Sacramento’, ‘Colorado’: ‘Denver’,’Connecticut’: ‘Hartford’, ‘Delaware’: ‘Dover’, ‘Florida’: ‘Tallahassee’, ‘Georgia’: ‘Atlanta’, ‘Hawaii’: ‘Honolulu’, ‘Idaho’: ‘Boise’, ‘Illinois’: ‘Springfield’, ‘Indiana’: ‘Indianapolis’, ‘Iowa’: ‘Des Moines’, ‘Kansas’: ‘Topeka’, ‘Kentucky’: ‘Frankfort’, ‘Louisiana’: ‘Baton Rouge’, ‘Maine’: ‘Agusta’, ‘Maryland’:… Continue reading Python code for creating a quiz generator with 35 different form contains same question but different order to prevent cheating.
Find the sum of formulas for saved search.
To get the sum of all the fields which is created using formula,take the actual formula used to create the fields and adjust the criteria and add them. For eg: Two fields are created using the formula coalesce(max(case when {systemnotes.field} in (‘Pipeline stage’) and {systemnotes.oldvalue} in (‘Opportunity’) then {systemnotes.date} when {systemnotes.field} in (‘Deal Status’) and… Continue reading Find the sum of formulas for saved search.
Auto-Numbering of Invoice Document number
To set up auto generated numbers for invoice, we need to enable Advanced Numbering feature.To enable the Advanced Numbering feature: Go to Setup > Company > Setup Tasks > Enable Features. In the Company subtab, scroll to the ERP General subsection and check the Advanced Numbering box. Click Save. We need to enable Advanced Numbering… Continue reading Auto-Numbering of Invoice Document number
Formula for saved search to get the recent dates from system note according to field change
Here need to get the recent date when the field pipeline stage has a value opportunity else the date should be null. Click on result tab and under columns select Formula(Date) : Summary Type : Maximum Description : coalesce(max( case when{systemnotes.field} in (‘Pipeline stage’) AND {systemnotes.newvalue} in (‘Opportunity’) then {systemnotes.date} end),Null). available filter : Internal… Continue reading Formula for saved search to get the recent dates from system note according to field change
Formula For Saved search which shows the systemnotes values using multiple case.
Formula(Date) : Summary Type : Maximum Description : coalesce(max(case when {systemnotes.field} in (‘Pipeline stage’) and {systemnotes.oldvalue} in (‘Opportunity’) then {systemnotes.date} when {systemnotes.field} in (‘Deal Status’) and {systemnotes.newvalue} in (‘Won’, ‘Lost’)then {systemnotes.date}end ), current_date ) available filter : Internal Id
Setup a field as mandatory using workflow
Workflow to make a custom field mandatory according to the employee type which is ‘Consultant’. And disable the field(field edit) for other employee type. Goto Customization → workflow → workflows. To set up the Labour cost Field mandatory for the employee type “consultant”: select the action type → Set Field Mandatory Trigger → After Field… Continue reading Setup a field as mandatory using workflow
Saved Search to Auto populate Custom Field(Here Credit memo)
To create a Save search, Go to the navigation list>search>saved searches>new. Choose the search type as Transaction. In Criteria Select Type –> Salesorder. set mainline is true and Cogs and shipping Line will be False. In results tab, from the joinfield related credit memo select amount and set Summary Type as ” Minimum” and Function… Continue reading Saved Search to Auto populate Custom Field(Here Credit memo)
Workflow to restrict Sales order form with a standard location.
Workflow to restrict Sales order form with a standard location. To create the workflow, Go to Customization> Workflow> Workflows> New. Record Type: TransactionSub Type: Sales OrderEvent Definition: Event BasedTrigger Type: All State 1New Action → Set Field Value Trigger On: Before User EditCondition: Custom Form!= JJ AHA – Sales Order Outlet Center And JJ User… Continue reading Workflow to restrict Sales order form with a standard location.
Delete the value of a field in the custom record when a related sales order will be deleted.
(record, search) => { const beforeSubmit = (scriptContext) => {try{if (scriptContext.type === scriptContext.UserEventType.DELETE) {let salesOrderId = scriptContext.newRecord.id;let openBoxSearch = search.create({type: ‘customrecord_jj_open_box_item_log1108’,filters: [[‘custrecord_jj_so_number_openboxitem1749’, ‘anyof’, salesOrderId]]});openBoxSearch.run().each(function(result) {let openBoxId = result.id;record.submitFields({type: ‘customrecord_jj_open_box_item_log1108’,id: openBoxId,values: {‘custrecordjj_item_sold_openboxlog1203’: false,‘custrecord_jj_so_date_openboxitem1749’: null}});return true;}); }}catch(err){log.error(“error in Beforesubmit”, err);}}return { beforeSubmit}});