Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Nov 25 15:24
    codingthat opened #158
  • Nov 25 08:45
    codingthat opened #157
  • Mar 20 2021 08:34
    pablo-s closed #2
  • Mar 20 2021 08:34
    pablo-s closed #3
  • Feb 10 2020 11:57
    assiomatica commented #156
  • Feb 10 2020 11:24
    sipmann commented #156
  • Dec 17 2019 05:33
    assiomatica opened #156
  • May 30 2019 18:29
    RickyKnollo opened #155
  • Apr 03 2019 01:59
    sipmann commented #154
  • Nov 19 2018 22:24
    jrichardsz opened #154
  • Nov 19 2018 22:21
    jrichardsz commented #148
  • Nov 19 2018 22:16
    jrichardsz commented #148
  • Apr 23 2018 07:22
    RD1991 opened #153
  • Apr 11 2018 21:57
    AndreasEK commented #148
  • Jan 07 2018 22:01
    Drulac opened #152
  • Dec 18 2017 10:55
    badlee commented #147
  • Dec 16 2017 05:46
    francescobianco opened #2
  • Nov 06 2017 15:35
    CGeorges commented #151
  • Nov 06 2017 15:28
    CGeorges synchronize #151
  • Nov 06 2017 15:27
    CGeorges synchronize #151
genfild
@genfild
several times to view messages, but found nothing.
CreativeWolf
@CreativeWolf
genfild
@genfild

I do not understand when to update the field 'status'

beforeSave: function(Entity, Console){
  Console.log("beforeSave");
  Console.log(Entity);
  Console.log(Entity.opf);
},

I see in the log editable fields { id: '576934e51bd8ad653db5e1b3', status: 'коммерческое предложение' }
but also to the immutable fields OOO

CreativeWolf
@CreativeWolf
@genfild I'm not able to comprehend, let me know what you are trying to do, I can try and help...
genfild
@genfild
I am trying to get a changed fields
when the user changes any field, I see in the log, but in fact have more access to all fields of Entity
I do not understand how to fill in the file attachment programmatically?
several times to view messages, but found nothing.
CreativeWolf
@CreativeWolf
@genfild You might want to try Console.log(Entityname.name);
replace Entityname to actual entity name
CreativeWolf
@CreativeWolf
Here's a working example...
     Applicants: {
        fields: {
          user: Fields.text("User Name").required(),
          applicantname: Fields.text("Applicant Name").required(),
          applicantemail: Fields.text("Applicant Email").required(),
          applicantphone: Fields.text("Applicant Phone").required(),
          positionapplied: Fields.fixedReference("Position Applied", "PositionsForReference").required(),
          positionorganization: Fields.fixedReference("Organization", "ClientForReference").required(),
          positionpostedby: Fields.fixedReference("Posted By", "ContactForReference").required(),
          applicantlastContactDate: Fields.date("Last Contact Date").required(),
          applicantstatus: Fields.fixedReference("Applicant Status", "AStatusForReference").required()
        },
        beforeUpdate: function(Entity, OldEntity, Crud, Security, Console) {
     Console.log(applicantStatus.name);
     Console.log(applicantStatus.id);
     return Security.asSystem(function () {
          if (Entity.ApplicantStatus.name != OldEntity.ApplicantAtatus.name) {
            if (Entity.ApplicantStatus.name == 'Applicant Joined') {
              return Crud.crudFor('Positions').find({}).then(function(last) {
                Entity.vacanciesopen = last[0].vacanciesopen;
                return Crud.crudFor('Positions').updateEntity({
                  id: last[0].id,
                  vacanciesopen: last[0].vacanciesopen - 1,
                  vacanciesclosed: last[0].vacanciesclosed + 1
                });
              })
            } else if (OldEntity.applicantstatus.name == 'Applicant Joined') {
              return Crud.crudFor('Positions').find({}).then(function(last) {
                Entity.vacanciesopen = last[0].vacanciesopen;
                return Crud.crudFor('Positions').updateEntity({
                  id: last[0].id,
                  vacanciesopen: last[0].vacanciesopen + 1,
                  vacanciesclosed: last[0].vacanciesclosed - 1
                });
              })
            }
          }
           });
           },
Hope that helps...
@sheaphillips Have you been able to get past the less error?
@sheaphillips As far as I could recall...there wasn't a follow up on this issue but one user reported this...and the stackoverflow link had such an issue reported as well...
But removing and reinstalling, initing the app again, solved it possibly...
Shea Phillips
@sheaphillips
@CreativeWolf no luck.. I even spun up a node 4.x docker container, and installed allcountjs from scratch, inited, etc. from there and got the same error.
Aarón Santiago
@aaron50x_twitter
hi everyone, i need to call btoa js native function from a beforeCreate CRUD callback, but an error raises saying that btoa is not defined :( ... can anyone help me to see what i'm doing wrong?
CreativeWolf
@CreativeWolf
@sheaphillips Which version are you using?
@aaron50x_twitter You'll have to use one of the CRUD Hooks, else will have to write custom AngularJS
Aarón Santiago
@aaron50x_twitter
@CreativeWolf i'm using CRUD hook beforeCreate
@CreativeWolf i need to use the function btoa
@CreativeWolf but an error is raised saying btoa is undefined
@CreativeWolf and also, when i try to use require() it also raises an error saying require is not defined :(
don't know what to do, stucked i this error
CreativeWolf
@CreativeWolf
@sheaphillips Check this please - https://gitter.im/allcount/allcountjs/archives/2016/02/01 and next two dates as well...
@aaron50x_twitter Can you paste the lines of code you are using please?
Aarón Santiago
@aaron50x_twitter
@CreativeWolf hi, I wasn't understanding how allcountjs, i started using last night, now I understand that allcountjs-server.js needs to be modified in order to add Api's. I think that an easier way to add them could be implemented. Thanks anyway, I could fix my problem :D
CreativeWolf
@CreativeWolf
@aaron50x_twitter Glad you figured and fixed 😀
Aarón Santiago
@aaron50x_twitter
@CreativeWolf by the way, great job with allcountjs, i have a working app in just minutes, with everything a need... thanks for such good product :)
CreativeWolf
@CreativeWolf
@aaron50x_twitter It is indeed. Thanks to @paveltiunov @chikh 😉
And the rest of the team!
I'm a user just like you are
Aarón Santiago
@aaron50x_twitter
excellent!! hope it keeps growing :)
CreativeWolf
@CreativeWolf
😀
elixirml
@elixirml

Hello friends
allcountjs started using a couple of days ago, I am making a summary sheet that gathers data from a pesona, but I need 3 different query data to complete the record before recording entities. for now only I can rescue data from an entity could give me a hand? as they would to make a crud on 3 different entities and access data from them?

thanks in advance for your valuable feedback
regards

CreativeWolf
@CreativeWolf
Heya @elixirml :)
You can take a look at Relationships https://allcountjs.com/docs/apps#relationships - Use reference :)
elixirml
@elixirml

Hi! CreativeWolf, I am using relationships, exactly reference to quickly complete the form 'Person', but I need to do some calculations before recording your data. I'm using beforeSave and in need do Crud on 3 different entities to make the final calculation and record the data.

thanks for your quick response

CreativeWolf
@CreativeWolf
@elixirml Exactly where are you stuck? Share your code maybe?
elixirml
@elixirml
of course, a moment please ...
elixirml
@elixirml
      Entidad1: {
        fields: {
          cantidadE1: Fields.integer("Cantidad E1")
        },
        referenceName: "cantidadE1"
      },
      Entidad2: {
        fields: {
          cantidadE2: Fields.integer("Cantidad E2")
        },
        referenceName: "cantidadE2"
      },
      Entidad3: {
        fields: {
          cantidadE3: Fields.integer("Cantidad E3")
        },
        referenceName: "cantidadE3"
      }
      EntidadTotal: {
        fields: {
          cantidadTotal: Fields.integer("Sum Cantidad")
        }
      }

      beforeSave: function (Entity, Crud) {
        return Crud.crudFor('Entidad1').readEntity(Entity.varEntidad1.id).then(function (varEntidad1) {
          Entity.entidad1Var = varEntidad1.cantidadE1;
          //here should consult data from other entities to perform the calculation
          Entity.entidad2Var = varEntidad2.cantidadE2;
          Entity.entidad3Var = varEntidad3.cantidadE2;
          //here should keep in EntidadTotal (I'm only supposed)
          Entity.cantidadTotal = //sum entidad1Var + entidad2Var +entidad3Var;
          })
      }
I hope you get the idea, I am still a beginner. thank you so much for your opinion
elixirml
@elixirml
sorry ... see detail beforeSave must be within Entity Total ... thanks
elixirml
@elixirml
I appreciate any feedback, thank you very much :smile:
CreativeWolf
@CreativeWolf
@elixirml Try this...
beforeSave: function (Entity) { Entity.cantidadTotal = Entity.cantidadE1 + Entity.cantidadE2 + Entity.cantidadE3; }
elixirml
@elixirml
well, I will try
thank you very much for your help :smile: :clap:
regards
genfild
@genfild
@maxcorrads I do not understand how to fill in the file attachment programmatically?
genfild
@genfild
      mpFiles:{
        fields:{
          planid: Fields.fixedReference("PlanId", "Query"),
How to implement Crud.crudFor("mpFiles")createEntity({planid: ??????? })
Tijl Dullers
@tdullers_twitter
Hi, Can anyone point out how to use a drop down list for an entry field, so I can force the user to chose from a list of values to fillup a text field ?